#pragma once
#include "PAKWriter.h"
#include "DeclarationManager.h"
#include "..\lib\container\List.h"

namespace ds {

class RenderTargetDecl : public ResourceDeclaration {

public:
	RenderTargetDecl(const std::string& name) : ResourceDeclaration(name) {}
	virtual ~RenderTargetDecl() {}
	void parseCategory(Category* category);
	DeclarationType getType() const {
		return DT_RENDER_TARGET;
	}		
	std::string& getMaterial() {
		return m_Material;
	}
	int getIndex() {
		return m_Index;
	}
	std::string& getLayers() {
		return m_Layers;
	}
private:
	std::string m_Material;
	int m_Index;
	std::string m_Layers;
};

class RenderTargetParser : public DeclarationParser {

public:
	RenderTargetParser() {}
	virtual ~RenderTargetParser() {}
	ResourceDeclaration* loadTextFile(const ResourceFile& resourceFile);
	void loadTextFile(const ResourceFile& resourceFile,DeclarationManager* declarationManager) {}
	void createResource(ResourceDeclaration* declaration);
	DeclarationType getType() const {
		return DT_RENDER_TARGET;
	}
	bool isSupported(const std::string& fileEnding) const;
	bool isReloadable() const {
		return false;
	}	
private:
	void split(const std::string& str,List<std::string>& words);
};

}

